#!/usr/bin/env python
# coding:utf-8

from __future__ import (absolute_import, division, print_function)
import pinject, glob, os, sys
from .Providers import *


class Container(object):
    classes = []
    module = None
    files = []

    def getFileList(self, directory):
        directory = os.getcwd() + '/Providers' if not directory else directory
        if os.path.isdir(directory):
            for d in os.listdir(directory):
                if os.path.isdir(d) is True:
                    self.getFileList(d)
                else:
                    print(d.find('.py'), d)
                    self.files.append(d)
        else:
            self.files.append(directory)

    def __init__(self):
        super(Container).__init__()
        print(dir)
        # self.getFileList(directory="")
        # print(self.files)
        for d in os.listdir(os.getcwd() + '/Providers'):
            self.getFileList(os.getcwd() + '/' + d)
        print('---')
        # self.obj_graph = pinject.new_object_graph(modules=None, classes=[])

